package com.spring.starter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
@Component
public class CDPlayer {
    @Autowired
    @Qualifier("sgtPeppers")
    public CompactDisc compactDisc;

    public CDPlayer(CompactDisc compactDisc) {
        this.compactDisc = compactDisc;
    }

    public void play(){
        this.compactDisc.say("天地大同.");
    }

}
